﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using OpenComposite.Mapper;

namespace OpenComposite.Workflow
{
	public partial class UISetSMTPHost : Form
	{
		public UISetSMTPHost()
		{
			InitializeComponent();
		}
		public UISetSMTPHost(ConfigSMTPInputData _input)
		{
			InitializeComponent();

			txt_host.Text = _input.SMTPServer;
			txt_user.Text = _input.SMTPUser;
			txt_password.Text = _input.SMTPPassword;
			txtSender.Text = _input.SMTPSender;
			txt_host.Focus();

			DialogResult = DialogResult.Cancel;
		}

		public ConfigSMTPInputData SMTPData
		{
			get
			{
				ConfigSMTPInputData returnValue = new ConfigSMTPInputData();
				returnValue.SMTPPassword = this.txt_password.Text;
				returnValue.SMTPServer = this.txt_host.Text;
				returnValue.SMTPUser = this.txt_user.Text;
				returnValue.SMTPSender = this.txtSender.Text;
				return returnValue;
			}
		}

		private void tsbtn_OK_Click(object sender, EventArgs e)
		{
			DialogResult = DialogResult.OK;
			this.Close();
		}

		private void tsbtn_Cancel_Click(object sender, EventArgs e)
		{
			DialogResult = DialogResult.Cancel;
			this.Close();
		}
	}
}